package com.elai.operate.controller;

import com.elai.common.annotation.Log;
import com.elai.common.core.controller.BaseController;
import com.elai.common.core.domain.AjaxResult;
import com.elai.common.core.page.TableDataInfo;
import com.elai.common.enums.BusinessType;
import com.elai.common.utils.poi.ExcelUtil;
import com.elai.operate.domain.OperatePalnDO;
import com.elai.operate.domain.OperatePlanDO;
import com.elai.operate.service.OperatePalnService;
import com.elai.operate.service.OperatePlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/operate/plan")
public class OperatePlanController extends BaseController {

    @Autowired
    private OperatePlanService operatePlanService;


    @GetMapping("/getPlanlist")
    public AjaxResult getPlanlist(OperatePlanDO operatePlan)
    {
        startPage();
        List<OperatePlanDO> list = operatePlanService.selectOperatePlanList(operatePlan);
        return AjaxResult.success(list);
    }
    /**
     * 新增运营计划
     */
    @Log(title = "运营计划", businessType = BusinessType.INSERT)
    @PostMapping("/insertOperatePlan")
    public AjaxResult insertOperatePlan(@RequestBody OperatePlanDO operatePlan)
    {
        return toAjax(operatePlanService.insertOperatePlan(operatePlan));
      //  return AjaxResult.success();
    }


}
